package dao

import "database/sql"

//Mysql
var Db *sql.DB

//数据库连接初始化
func InitMysql() {
	var err error
	//>go get github.com/go-sql-driver/mysql
	Db, err = sql.Open("mysql", DbCfg.DbUser+":"+DbCfg.DbPass+"@tcp("+DbCfg.DbHost+":"+DbCfg.DbPort+")/"+DbCfg.DbName+"?charset=utf8")
	if err != nil {
		panic(err)
	}

	Db.SetMaxOpenConns(100)
}
